# _*_coding     : UTF_8_*_
# Author        :Jie Shen
# CreatTime     :2021/12/14 9:39

import urllib.request
from bs4 import BeautifulSoup

url = "https://lishi.tianqi.com/wuhan/201101.html"
req = urllib.request.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36') #set user-agent header
req.add_header('Cookie','UM_dis3aa97') # 更改cookie
response = urllib.request.urlopen(req)
soup = BeautifulSoup(response, "html.parser")
print(soup.title)